<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Symbol创建对象属性</title>
</head>
<script>
    //向对象中添加方法
    let game = {
        name:'张三'
    }
    let methods = {
        up: Symbol('up'),
        down: Symbol('down')
    }
    game[methods.up] = function() {
        console.log('我可以改变形状')
    }
    game[methods.down] = function() {
        console.log('我可以快速下降')
    }
    console.log(game)
</script>
</html>